/*
 * motor.h
 *
 *  Created on: Jan 14, 2017
 *      Author: YzZe
 */

#ifndef MOTOR_H_
#define MOTOR_H_

#include "stm32f1xx_hal.h"


extern TIM_HandleTypeDef htim1;

void Motor_GPIO_Init(void);
void Motor_TIM1_Init(uint16_t arr,uint16_t psc);
void TIM_SetTIM1Compare1(uint32_t compare);
void TIM_SetTIM1Compare4(uint32_t compare);

void Motor_Stop(void);
void Motor_Left_Ahead(uint32_t speed);
void Motor_Left_Back(uint32_t speed);
void Motor_Right_Ahead(uint32_t speed);
void Motor_Right_Back(uint32_t speed);

void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);

void Error(void);
#endif /* MOTOR_H_ */
